﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Feedback : System.Web.UI.Page
{
   
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
        {
            if (Session["customer"] != null)
            {
                Customer c = (Customer)Session["customer"];
                txtName.Text = c.Name;
                txtEmail.Text = c.Email;
            }
            else 
            {
                Response.Redirect("Login.aspx");
            }
        }
    }

    protected void btnsend_Click(object sender, EventArgs e)
    {

    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        if (txtContent.Text == "")
        {
            lblError.Text = "Content must not null";
        }
        else
        {
            bussiness bus = new bussiness();
            Customer c = (Customer)Session["customer"];
            bus.insertFeedback(c.CustomerId,txtContent.Text);
            lblError.Text = "";
            lblSuccessful.Text = "Submit successful";
            txtContent.Text = "";
        }
    }
}